<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let i = 0;
      // 假设这段代码的运行时间 >100ms

      // const d1 = new Date();
      for (let j = 0; j < 1000000000; j++) {
        i++; //0.5s
      }
      // const d2 = new Date();
      console.log(1);
      setTimeout(() => {
        console.log(i);
      }, 3000);
    </script>
  </body>
</html>
